//
//  YYT_ChannelCollectionViewCell.m
//  AudioVisualFeast
//
//  Created by dllo on 16/2/27.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "YYT_ChannelCollectionViewCell.h"
#import "UIImageView+WebCache.h"

@implementation YYT_ChannelCollectionViewCell
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        _imgImage = [[UIImageView alloc] initWithFrame:CGRectZero];
        _titlelabel = [[UILabel alloc] initWithFrame:CGRectZero];
        _titlelabel.textColor = [UIColor lightGrayColor];
        [self addSubview:self.imgImage];
        [self addSubview:self.titlelabel];
    }
    return self;
}

- (void)layoutSubviews {
    self.imgImage.frame = CGRectMake(0, 0, 187, 160);
    self.titlelabel.frame = CGRectMake(0, 140, self.frame.size.width, 20);
}

- (void)setChannel:(YYT_ChannelModle *)channel {
    
    _channel = channel;
    
    [self.imgImage sd_setImageWithURL:[NSURL URLWithString:_channel.img]];
    self.titlelabel.text = _channel.title;
}

@end
